package com.cn.jinl.controller;


import com.cn.jinl.api.IChenxingMachineService;
import com.cn.jinl.domain.ChenxingMachine;
import com.cn.jinl.utils.CommonUtil;
import com.cn.jinl.utils.JsonResponse;
import com.cn.jinl.utils.QueryForm;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/chenxingMachine")
public class ChenxingMachineController {

    @Autowired
    private IChenxingMachineService chenxingMachineService;

    @RequestMapping("/api/getChenxingMachineMaps")
    @ResponseBody
    public JsonResponse<Map<String,Object>> getChenxingMachineMaps() throws Exception {
        JsonResponse<Map<String,Object>> response = new JsonResponse<Map<String,Object>>();
        Map<String,Object> maps  = chenxingMachineService.getChenxingMachineMaps();
        response.setResult(maps);
        response.setSuccess(true);
        return  response;
    }

    //更新成型启动检
    @ResponseBody
    @RequestMapping("/api/updateChenxingMachine")
    public JsonResponse<String> updateChenxingMachine(ChenxingMachine chenxingMachine) throws Exception {
        JsonResponse<String> response = new JsonResponse<String>();
        String result = chenxingMachineService.updateChenxingMachine(chenxingMachine);
        return CommonUtil.getResponseData(response,result);
    }
}
